<template>
  <div>
    <el-form size="mini" inline>
      <el-form-item>
        <el-date-picker
          v-model="summarYear"
          type="year"
          placeholder="选择年"
          value-format="yyyy"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-input placeholder="合作单位" v-model="constuct" clearable>
        </el-input>
      </el-form-item>
      <el-form-item>
        <el-input placeholder="项目名称" v-model="manage" clearable> </el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="query">
          查询
        </el-button>
      </el-form-item>
    </el-form>
    <Ca-rule-table
      :DataList="summaryList"
      :header="header"
      :sortable="false"
    ></Ca-rule-table>
    <paging
      :currentpage="currentpage"
      :currentlimit="currentlimit"
      :total="total"
      @setlimit="getlimit"
      @setpage="getpage"
    ></paging>
  </div>
</template>

<script>
import { apiProjectSummary } from "@/request/api";
export default {
  data() {
    return {
      constuct: "",
      manage: "",
      summarYear: "",
      summaryList: [],
      currentlimit: 15,
      currentpage: 1,
      total: 0,
      header: [
        ["合作单位", "constuct_project_dep_name", ""],
        ["项目名称", "manage_contract_name", 120],
        [
          "合同信息",
          "",
          "",
          "",
          [
            ["合同编号", "manage_contract_num", ""],
            ["签订日期", "manage_contract_startTime", ""],
            ["合同金额", "manage_contract_amount", ""]
          ]
        ],
        [
          "应扣款明细",
          "",
          "",
          "",
          [
            [
              "固定项",
              "",
              "",
              "",
              [
                ["管理费", "manage_drawMoney_manageFee", ""],
                ["税费", "manage_drawMoney_Taxes", ""]
              ]
            ],
            ["合计金额", "TotalDeduction", ""]
          ]
        ],
        [
          "应付款明细",
          "",
          "",
          "",
          [
            [
              "已收款金额",
              "",
              "",
              "",
              [
                ["时间", "manage_drawMoney_recieveDate", ""],
                ["金额", "manage_drawMoney_recieve", ""]
              ]
            ],
            [
              "付款时间及金额",
              "",
              "",
              "",
              [
                ["时间", "manage_drawMoney_payTime", ""],
                ["金额", "manage_drawMoney_thisDraw", ""]
              ]
            ]
          ]
        ],
        ["可提金额", "manage_drawMoney_getOut", ""],
        [
          "发票明细",
          "",
          "",
          "",
          [
            [
              "开票信息",
              "",
              "",
              "",
              [
                ["开票日期", "manage_billingDate", ""],
                ["开票金额", "manage_drawMoney_invoiceAmount", ""]
              ]
            ],
            [
              "进项票",
              "",
              "",
              "",
              [["开票类型", "manage_drawMoney_invoiceCompany", ""]]
            ]
          ]
        ]
      ]
    };
  },
  created() {
    this.getSumList();
  },
  methods: {
    getlimit(e) {
      this.currentlimit = e;
      this.getSumList();
    },
    getpage(e) {
      this.currentpage = e;
      this.getSumList();
    },
    query() {
      this.currentlimit = 15;
      this.currentpage = 1;
      this.getSumList();
    },
    getSumList() {
      apiProjectSummary({
        year: this.summarYear,
        pageSize: this.currentlimit,
        limit: this.currentpage,
        constuct_project_dep_name: this.constuct,
        manage_contract_name: this.manage
      }).then(res => {
        this.total = res.total;
        this.summaryList = res.data;
      });
    }
  }
};
</script>

<style lang="scss" scoped></style>
